<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<style>
    .item-box{
        border: 1px solid #9fbbb4; overflow: hidden; padding:0  3px 0 3px;margin-bottom: 3px;
    }
    .item-box .item-box-title {
        float: left;text-align: center;  font-weight: 800;padding: 8 2px 0 0;width: 100%;
    }
    .form-contanier{
        /*height: 50px; line-height: 50px;*/padding: 0 0 0 3px;width: 950px;
    }
    .form-contanier label{
        font-weight: 400;
    }
    .form-contanier label{
        width: 100px;
    }
    .form-contanier span{
        display: inline-block;
        min-width: 90px;
    }
    .form-contanier input{
        width: 100px;
    }
    #base_info label{width: 100px;display: inline-block}
    #base_info span{width: 200px;display: inline-block}
</style>
<script src="${ctxStatic}/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/layer/layer.js"></script>
<script>
    function  autoAdaptHeight() {
        $(".form-contanier").each(function (index,dom) {
            var autoHeight=$(this).closest(".item-box-center").outerHeight(true);
            $(this).css("height",autoHeight);
            $(this).closest(".item-box").find(".item-box-title").each(function (index,dom) {
                $(dom).css("height",autoHeight).css("line-height",autoHeight+"px");
            });
            $(this).closest(".item-box").find(".item-box-right").each(function (index,dom) {
                $(dom).css("height",autoHeight).css("line-height",autoHeight+"px");
            })
        });
    }
    $(function () {
        $(".up_item").find("a").remove();
        autoAdaptHeight();
      /*  $(".pic").click(function(){
            var url=$(this).attr("src");
            //页面层
            layer.open({
                type: 1,
                title:"资料大图",
                offset:["10px","100px"],
                skin: 'layui-layer-rim', //加上边框
                area: ['auto', 'auto'], //宽高
                content: '<img style="min-width: 100px;min-height: 100px;"  src="'+url+'"/>'
            });
        });*/
    });
</script>
<div style="padding: 20px" id="item_container">
    <div class="item-box">
        <div  class="item-box-title" >
           客户个人信息
        </div>
        <div style="text-align: center" class="item-box-center">
                <div  id="base_info" style="min-height:40px;line-height:40px;padding-top: 10px;width: 100%">
                    <div>
                        <label> 姓名：</label>
                        <span> ${member.username}</span>
                        <label> 性别：</label>
                        <span> ${member.sex}</span>
                    </div>

                    <div>
                        <label> 生日：</label>
                         <span> ${member.birthdayStr}</span>
                        <label> 籍贯：</label>
                        <span> ${member.nativeProvince}${member.nativeCity}${member.nativeCounty}${member.nativeDetail}</span>
                    </div>

                    <div>
                      <label> 现居住地：</label>
                         <span>  ${member.residentProvince}${member.residentCity}${member.residentCounty}${member.residentDetail}</span>
                        <label> 婚姻状况：</label>
                        <span>
                            <c:choose>
                                <c:when test="${member.maritalStatus=='0'}">未婚</c:when>
                                <c:when test="${member.maritalStatus=='1'}">已婚</c:when>
                                <c:when test="${member.maritalStatus=='2'}">离异</c:when>
                                <c:when test="${member.maritalStatus=='3'}">丧偶</c:when>
                                <c:otherwise>未知</c:otherwise>
                            </c:choose>
                        </span>
                    </div>

                    <div>
                         <label> 工作单位：</label>
                         <span>  ${member.company}</span>
                         <label> 单位性质：</label>
                         <span>  ${member.companyType}</span>
                    </div>
                    <div>
                        <label> 职务：</label>
                         <span>  ${member.job}</span>
                        <label> 入职时间：</label>
                        <span>  ${member.entryTimeStr}</span>
                    </div>
                    <div>
                         <label> 月收入：</label>
                         <span>  ${member.monthIncome}</span>
                    </div>
                </div>
        </div>
    </div>
    <c:if test="${fn:length(ret)<1}">
        暂无上传资料
    </c:if>
    <c:forEach var="item" items="${ret}" varStatus="retStatus">
        <form id="item_form">
            <div class="item-box">
                <div  class="item-box-title" >
                        ${item.key.name}
                </div>
                <div style="float: left" class="item-box-center">
                    <input  type="hidden" value="${item.value[0].groupId}" name="groupId">
                    <div class="form-contanier">
                            <%--遍历该类型的所有资料类型 例如身份证下面的所有资料类型--%>
                        <c:forEach var="type" items="${item.key.children}" varStatus="status" >
                            <div id="up_item" style="display: inline-block;width: 300px;float: left;min-height:40px;line-height:40px;">
                                <label> ${type.name}:</label>
                                <span class="up_item">
                                <c:choose>
                                    <%--radio类型--%>
                                    <c:when test="${'radiobox'==type.type}">
                                        <c:forEach var="keyValue" items="${type.keyValues}">
                                             <c:forEach var="obj" items="${item.value}"><c:if test="${obj.value==keyValue.value}">${keyValue.label} </c:if></c:forEach>
                                        </c:forEach>
                                    </c:when>
                                    <%--图片类型--%>
                                    <c:when test="${'fileselect'==type.type}">
                                        <%--遍历该类型用户上传的所有资料 例如用户上传的所有身份证资料--%>
                                        <input type="hidden" name="typeId" value="${type.id}" >
                                        <input type="hidden" name="id" value="<c:forEach var="obj" items="${item.value}"><c:if test="${obj.typeId==type.id}">${obj.id}</c:if></c:forEach>" >
                                        <c:forEach var="obj" items="${item.value}">
                                            <c:if test="${obj.typeId==type.id}"> <img src="${obj.url}"  width="100" height="100" class="pic" /></c:if>
                                        </c:forEach>
                                    </c:when>
                                    <%-- 普通文本类型 --%>
                                    <c:otherwise>
                                        <label><c:forEach var="obj" items="${item.value}"><c:if test="${obj.typeId==type.id}">${obj.value}</c:if></c:forEach></label>
                                    </c:otherwise>
                                </c:choose>
                            </span>
                            </div>
                        </c:forEach>
                    </div>
                </div>
            </div>
        </form>
    </c:forEach>
</div>

